home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # Copyright (c) 1987 Bellcore
- # All Rights Reserved
- # Permission is granted to copy or use this program, EXCEPT that it
- # may not be sold for profit, the copyright notice must be reproduced
- # on copies, and credit should be given to Bellcore where it is due.
- # BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
-
- # $Header: square,v 4.1 88/06/21 14:01:40 bianchi Exp $
- # $Source: /tmp/mgrsrc/demo/sh/RCS/square,v $
-
- # square a window
-
- ESC=""
- SHAPE="W"
- SIZE="4I"
-
- if /bin/test $TERM != mgr
- then
- echo "$0 only works on mgr terminals"
- exit 1
- fi
-
- # get current size
-
- stty -echo
- echo -n "${ESC}${SIZE}"
- read x y wide high
- stty echo
- case $# in
- 0) echo -n "${ESC}$x,$y,$wide,$wide$SHAPE" ;;
- 1) echo -n "${ESC}$x,$y,$1,$1$SHAPE" ;;
- 2) high=`expr $1 '*' $2 / 100`
- echo -n "${ESC}$x,$y,$1,$high$SHAPE" ;;
- *) echo "usage: $0 [size] [aspect ratio]";;
- esac
-